package com.jt.www.dao.mapper.market;

import com.jt.www.dao.BaseMapper;
import com.jt.www.domain.po.TeamFounderEntity;
import com.jt.www.domain.qo.TeamFounderExportQO;
import com.jt.www.domain.qo.TeamFounderInfoQO;
import com.jt.www.domain.qo.TeamMembersQO;
import com.jt.www.domain.vo.*;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public interface TeamFounderMapper extends BaseMapper<TeamFounderEntity> {

    Integer countTeamFounders(@Param("teamFounderInfoQO") TeamFounderInfoQO teamFounderInfoQO);

    List<TeamFounderInfoVO> selectTeamFounders(@Param("teamFounderInfoQO") TeamFounderInfoQO teamFounderInfoQO);

    List<TeamFounderInfoVO> exportTeamFounders(@Param("teamFounderExportQO") TeamFounderExportQO teamFounderExportQO);

    /**
     * 根据创始人ID查询创始人详细信息
     *
     * @param teamFounderId
     * @return
     */
    List<TeamFounderInfoVO> queryTeamFounderDetail(@Param("teamFounderId") Long teamFounderId);

    /**
     * 根据创始人ID查询小队列表
     *
     * @param teamFounderId
     * @return
     */
    List<TeamInfoVO> queryTeamsDetail(@Param("teamFounderId") Long teamFounderId);

    /**
     * 根据条件查询成员列表
     *
     * @param teamMembersQO
     * @return
     */
    List<TeamMembersVO> queryTeamMembersDetail(@Param("teamMembersQO") TeamMembersQO teamMembersQO);

    /**
     * 通过营销员员工编号查询小队相关信息
     *
     * @param marketerNo
     * @param isQueryAllHistory 是否查询所有被删除的历史记录
     */
    List<CommissionTeamVO> queryTeamByMarketerNo(@Param("marketerNo") String marketerNo, @Param("isQueryAllHistory") String isQueryAllHistory);

    /**
     * 通过userCode 查询营销员查询角色信息
     *
     * @param userCode
     * @return
     */
    MarketerUserRoleVo selectMarketerRoleByUserCode(@Param("userCode") String userCode);

    /**
     * 通过分支机构查询创始人列表
     *
     * @param branchCode
     * @return
     */
    List<FounderVo> queryTeamFoundersByBranchCode(@Param("branchCode") String branchCode);
}
